package com.techstar.ats.status;

import java.util.Set;

public enum SwitchStatus implements StatusEnumerated {
	CI_OCCUPIED(0x00000002, "联锁报告道岔占用"),
	CBTC_OCCUPIED(0x00000004, "CBTC报告列车占用该道岔"),
	LOCKED(0x00000008, "道岔锁闭"),
	FAIL_LOCKED(0x00000010, "道岔故障锁闭"),
	NORMAL(0x00000020, "道岔定位"),
	REVERSE(0x00000040, "道岔反位"),
	BLOCKED(0x00000080, "道岔单锁"),
	JAMMED(0x00000100, "道岔挤岔"),
	EXPECT_LOCK(0x00000200, "期望锁闭"),
	EXPECT_UNLOCK(0x00000400, "期望解除锁闭"),
	EXPECT_NORMAL(0x00000800, "进路和道岔单操命令中的期望道岔定位"),
	EXPECT_REVERSE(0x00001000, "进路和道岔单操命令中的期望道岔反位"),
	EXPECT_BLOCK(0x00002000, "期望道岔单锁"),
	EXPECT_UNBLOCK(0x00004000, "期望道岔解除单锁"),
	IN_ROUTE(0x00008000, "是否在进路中锁闭，控制是否需要显示锁闭"),
	MANUAL_MODE(0x00010000, "道岔为手动操作模式"),
	CUT(0x00020000, "道岔切除"),
	ATC_INVALID(0x00040000, "道岔区段被ATC报告失效"),
	OVERLAP(0x00080000, "OVERLAP"),
	TSR_CBTC_MAIN(0x00100000, "CBTC岔前限速"),
	TSR_CBTC_NORMAL(0x00200000, "CBTC定位限速"),
	TSR_CBTC_REVERSE(4194304, "CBTC反位限速"),
	TSR_BM_MAIN(0x00800000, "BM岔前限速"),
	TSR_BM_NORMAL(0x01000000, "BM定位限速"),
	TSR_BM_REVERSE(0x02000000, "BM反位限速"),
	//	BLOCKED(0x04000000,"道岔封锁"),
	LOST_INDICATION(0x08000000, "道岔失表示");

	private final int value;
	private final String literal;

	SwitchStatus(int value, String literal) {
		this.value = value;
		this.literal = literal;
	}

	@Override
	public int value() {
		return this.value;
	}

	@Override
	public String literal() {
		return this.literal;
	}

	public static Set<SwitchStatus> valueOf(int mask) {
		return StatusEnumerated.valueOf(SwitchStatus.class, mask);
	}
}
